<template>
    <div class="reply">
        <div class="info">
            <img :src="data.member.avatar+'@60w_60h_1c.png'" alt="" class="userpic">
            <div>
                <span class="name">{{data.member.uname}}</span>
                <span class="date">{{dateForm(data.ctime*1000)}}</span>
            </div>
        </div>
        
        <div class="content">
            <p class="message">
                {{data.content.message}}
            </p>
            <div class="rpls">
                <p class="rpl" v-for="(item,index) in data.replies" :key="index">
                   <span>{{item.member.uname+'：'}}</span> {{item.content.message}}
                </p>
                <span class="rcount">共{{data.rcount}}条回复 ></span>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    props:[
        'data'
    ],
    methods:{
        dateForm(dateInt){
            var date=new Date(dateInt)
            return date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate()
        }
    }
}
</script>

<style lang='less' scoped>
@import '../../assets/css/common';
.reply{
    background-color: #fff;
    padding: 1rem;
    border-bottom: 0.1rem solid #e4e4e4;
    p{
        color: #000;
        font-size: 1.1rem;
    }
    .info{
        display: flex;
        .userpic{
            border-radius: 3rem;
            margin-top: 0.4rem;
            width: 2.5rem;
            height: 2.5rem;
        }
        div{
            margin-left: 1.2rem;
            span{
                display: block;
                font-size: 1.1rem;
                &.name{
                    color: #777;
                }
                &.date{
                    color: #999;
                    margin-top: 0.5rem;
                    font-size: 1rem;
                }
            }
        }
    }
    
    .content{
        padding: 0 0 0 3.6rem;
        .message{
            margin: 1rem 0 ;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 6;
            overflow: hidden;
        }
        .rpls{
            background-color: #f4f4f4;
            border-radius: 0.3rem;
            padding-top: 0.6rem;
            span{
                color: #5090cc;
            }
            .rpl{
                padding: 0.5rem 0.7rem;
                padding-right: 0.7rem;
                padding-bottom: 0;
                display: -webkit-box;
                -webkit-box-orient: vertical;
                -webkit-line-clamp: 2;
                overflow: hidden;
            }
            .rcount{
                padding: 0.7rem;
                display: block;
            }
        }
    }
}

</style>